import { LocalstorageEnum } from "@/types/localstorage.ts";
import { version } from "../../package.json";
export const setLocalStorage = (type: LocalstorageEnum, value: any) => {
  localStorage.setItem(type + version, JSON.stringify(value));
};

export const getLocalStorage = (type: LocalstorageEnum) => {
  const value = localStorage.getItem(type + version);
  return value ? JSON.parse(value) : undefined;
};

export const removeLocalStorage = (type: LocalstorageEnum) => {
  localStorage.removeItem(type + version);
};
